/**
 * @param {string} s
 * @param {number} k
 * @return {boolean}
 */
var canConstruct = function(s, k) {
  if(k > s.length) return false;
  let alpha = new Array(26).fill(0);
  for(let i = 0; i < s.length; i++) {
    alpha[s[i].charCodeAt() - 'a'.charCodeAt()]++;
  }
  let odd = 0;
  for(let i = 0; i < 26; i++) {
    if(alpha[i] % 2) odd++;
  }
  if(k >= odd) return true;
  return false;
};
let s = "annabelle", k = 2;
console.log(canConstruct(s, k));
s = "leetcode", k = 3;
console.log(canConstruct(s, k));
s = "true", k = 4;
console.log(canConstruct(s, k));
s = "yzyzyzyzyzyzyzy", k = 2;
console.log(canConstruct(s, k));
s = "cr", k = 7;
console.log(canConstruct(s, k));
